/**
 * 
 */
package demo.tellurium.module

import org.telluriumsource.dsl.DslContext;

import demo.tellurium.framework.BaseUIModule;

/**
 * @author roger.xu
 *
 */
public class BaiduSearchModule extends BaseUIModule {

    @Override
    public void defineUi() {
        ui.Container(uid: "Baidu", clocator: [tag: "form", action: "s", name: "f"]) {
            InputBox(uid: "Input", clocator: [tag: "input", type: "text", id: "kw", name: "wd"])
            SubmitButton(uid: "Search", clocator: [tag: "input", type: "submit", id: "su", value: "百度一下"])
        }
    }

    public void doSearch(String input) {
        type "Baidu.Input", input
        pause 500
        click "Baidu.Search"
        waitForPageToLoad 30000
        pause 5000
    }
}
